const webpack = require('webpack')
const merge = require('webpack-merge');
const base = require('./webpack.base.js');

const devConfig = {
  devtool: 'eval-source-map',
  optimization: {
    usedExports: true //模块中只引入使用了的方法(函数)
  },
  devServer: {
    host: '0.0.0.0', // 主机地址
    port: 8000, // 端口号
    // open: true,
    inline: true,
    contentBase: './dist',
    historyApiFallback: true,
    overlay: {
      errors: true,
    },
    proxy: {
      "/service": {
        // target: "http://222.240.233.71:8142/",
        target: "https://bchelper-web-sanyecc.rootcloudapp.com/",
        changeOrigin: true,
        // pathRewrite: {'^/api' : ''}
      }
    },
  },
}


module.exports = merge(base, devConfig)